package com.atguigu.springcloud.cloudsentinelgatewaydevelop.mapper;

import com.atguigu.springcloud.cloudsentinelgatewaydevelop.bean.dto.SentinelDegradeRuleDTO;
import org.springframework.data.r2dbc.repository.Modifying;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import reactor.core.publisher.Mono;

public interface DegradeRuleMapper extends ReactiveCrudRepository<SentinelDegradeRuleDTO,Long> {
    @Modifying
    @Query("delete from sentinel_degrade_rule sdr where sdr.id = :id")
    Mono<Integer> deleteByID(Long id);

    @Modifying
    @Query("delete from sentinel_degrade_rule sdr where sdr.application_name = :applicationName")
    Mono<Integer> deleteByAyApplicationName(String applicationName);
}
